﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using BadmintonApp.Entity;
using BadmintonApp.Factory;
using BadmintonApp.BLL.Interface;
using BadmintonApp.DAO.Interface;

namespace BadmintonApp.BLL.Implement
{
    public class RechargeBLL : IRechargeBLL
    {
        private IRechargeDAO dao;

        public RechargeBLL()
        {
            dao = DaoFactory.CreateRechargeDAO();
        }

        #region IRechargeBLL Members

        /// <summary>
        /// 插入充值信息
        /// </summary>
        /// <param name="rechargeInfo">充值信息类</param>
        public void InsertRecharge(TRechargeInfo rechargeInfo)
        {
            dao.InsertRecharge(rechargeInfo);
        }

        /// <summary>
        /// 更新充值信息
        /// </summary>
        /// <param name="rechargeInfo">充值信息类</param>
        public void UpdateRecharge(TRechargeInfo rechargeInfo)
        {
            dao.UpdateRecharge(rechargeInfo);
        }

        /// <summary>
        /// 删除充值信息
        /// </summary>
        /// <param name="rechargeID">充值ID</param>
        public void DeleteRecharge(int rechargeID)
        {
            dao.DeleteRecharge(rechargeID);
        }

        /// <summary>
        /// 获取所有充值信息
        /// </summary>
        /// <returns>充值数据集</returns>
        public DataSet GetAllRecharge()
        {
            return dao.GetAllRecharge();
        }

        /// <summary>
        /// 根据过滤条件获取充值信息
        /// </summary>
        /// <param name="sFilter">过滤条件</param>
        /// <returns>充值数据集</returns>
        public DataSet GetRechargeByFilter(string sFilter)
        {
            return dao.GetRechargeByFilter(sFilter);
        }

        #endregion
    }
}
